module SRI
  class Program
    attr_reader :functions, :constants, :pe_functions, :body
    
    def initialize( ast )
      @body = ast
      @functions = {}
      ast = [ast] unless ast.is_a? Array
      ast.each do |node|
        @functions[node.name] = node if node.is_a? Method
      end
      @pe_functions = {}
      @constants = {}
    end
    
    def self.pe_function_name( method, args )
      method.to_s + "##{args.size}"
    end
  end
end
